package com.example.pruebawiii;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.Menu;
import android.widget.ImageView;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        TableLayout table = new TableLayout(this);  
        
        table.setStretchAllColumns(true);  
        table.setShrinkAllColumns(true);  
      
        TableRow rowTitle = new TableRow(this);  
        rowTitle.setGravity(Gravity.CENTER_HORIZONTAL);  
      
        TableRow rowDayLabels = new TableRow(this);  
        TableRow rowHighs = new TableRow(this);  
        TableRow rowLows = new TableRow(this);  
        TableRow rowConditions = new TableRow(this);  
        rowConditions.setGravity(Gravity.CENTER);  
      
        TextView empty = new TextView(this);  
      
        // title column/row  
        TextView title = new TextView(this);  
        title.setText("Lista Restaurantes");  
      
        title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);  
        title.setGravity(Gravity.CENTER);  
        title.setTypeface(Typeface.SERIF, Typeface.BOLD);  
      
        TableRow.LayoutParams params = new TableRow.LayoutParams();  
        params.span = 6;  
      
        rowTitle.addView(title, params);  
      
//        // labels column  
//        TextView highsLabel = new TextView(this);  
//        highsLabel.setText("Day High");  
//        highsLabel.setTypeface(Typeface.DEFAULT_BOLD);  
//      
//        TextView lowsLabel = new TextView(this);  
//        lowsLabel.setText("Day Low");  
//        lowsLabel.setTypeface(Typeface.DEFAULT_BOLD);  
//      
//        TextView conditionsLabel = new TextView(this);  
//        conditionsLabel.setText("Conditions");  
//        conditionsLabel.setTypeface(Typeface.DEFAULT_BOLD);  
//      
//        rowDayLabels.addView(empty);  
//        rowHighs.addView(highsLabel);  
//        rowLows.addView(lowsLabel);  
//        rowConditions.addView(conditionsLabel);  
//      
        // day 1 column  
        TextView day1Label = new TextView(this);  
        day1Label.setText("Nombre");  
        day1Label.setTypeface(Typeface.SERIF, Typeface.BOLD);  
      
        TextView day1High = new TextView(this);  
        day1High.setText("Restaurante1");  
        day1High.setGravity(Gravity.CENTER_HORIZONTAL);  
      
        TextView day1Low = new TextView(this);  
        day1Low.setText("Restaurante2");  
        day1Low.setGravity(Gravity.CENTER_HORIZONTAL);  
      
          
      
        rowDayLabels.addView(day1Label);  
        rowHighs.addView(day1High);  
        rowLows.addView(day1Low);  
        
      
        // day2 column  
        TextView day2Label = new TextView(this);  
        day2Label.setText("Descripcion");  
        day2Label.setTypeface(Typeface.SERIF, Typeface.BOLD);  
      
        TextView day2High = new TextView(this);  
        day2High.setText("Descripcion1");  
        day2High.setGravity(Gravity.CENTER_HORIZONTAL);  
      
        TextView day2Low = new TextView(this);  
        day2Low.setText("Descripcion2");  
        day2Low.setGravity(Gravity.CENTER_HORIZONTAL);  
      
      
        rowDayLabels.addView(day2Label);  
        rowHighs.addView(day2High);  
        rowLows.addView(day2Low);  
        
      
        
      
        table.addView(rowTitle);  
        table.addView(rowDayLabels);  
        table.addView(rowHighs);  
        table.addView(rowLows);  
        table.addView(rowConditions);  
      
        setContentView(table);  
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
